#ifndef WF_MODIFYMOVEROTATE_H
#define WF_MODIFYMOVEROTATE_H

#include "pf_previewactioninterface.h"
#include "pf_modification.h"
#include "gui_export.h"

/**
 * This action class can handle user events to move and at the same
 * time rotate entities.
 *
 */
class GUI_EXPORT WF_ModifyMoveRotate : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetReferencePoint,    /**< Setting the reference point. */
        SetTargetPoint,       /**< Setting the target point. */
        ShowDialog,           /**< Showing the options dialog. */
		SetAngle              /**< Setting angle in command line. */ 
    };

public:
    WF_ModifyMoveRotate(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_ModifyMoveRotate() {}
	
	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);
	
	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionModifyMoveRotate;
	}

    virtual void init(int status=0);
	
    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();

    virtual void hideOptions();
    virtual void showOptions();
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

	void setAngle(double a) {
		data.angle = a;
	}
	double getAngle() {
		return data.angle;
	}

private:
    PF_MoveRotateAttribute data;
    PF_Vector targetPoint;

	/** Last status before entering angle. */
	Status lastStatus;
	/**
	 * Commands
	 */
	PF_String cmdAngle;
	PF_String cmdAngle2;
	PF_String cmdAngle3;
};

#endif
